<?php

require_once("root.php");
require_once($ROOT . "base.inc.php");

class SongTest extends BaseTest {

   function test ()
   {
		$kiss = new Song(0, "Kiss the New Day", "The Green Letters", "", "", "B", "T");
		$home = new Song(0, "Home for the Winter", "The Green Letters", "", "", "C", "T");
		$to_thee = new Song(0, "To Thee", "The Green Letters", "", "", "C", "F");
		$banditos = new Song(0, "Banditos", "The Refreshments", "", "", "E", "T");

		SongLogic::save($kiss);
		SongLogic::save($home);
		SongLogic::save($to_thee);
		SongLogic::save($banditos);

		print_r(SongLogic::findAll());

		SongLogic::deactivate($home->id);

		echo "\n\nAll Active\n";
		print_r(SongLogic::findActive());

		echo ("\n\n'Green Letters'  search\n");
		print_r(SongLogic::findByAuthor("Green Letters"));

		$test = SongLogic::load($kiss->id);

		echo "\n\nKiss the New Day : \n";
		print_r($test);

		$ex = new Song(0, "", "The Green", "", "", "B", "T");
		print_r(SongLogic::findByExample($ex));


		SongLogic::delete($kiss->id);
		SongLogic::delete($home->id);
		SongLogic::delete($to_thee->id);
		SongLogic::delete($banditos->id);

		echo "\n\nAll Deleted :\n";
        print_r(SongLogic::findAll());
   }

}

echo "<pre>";
$test = new SongTest();
$test->test();
echo "</pre>";


?>
